package com.wsmhz.security.core.social;

import org.springframework.social.security.SocialAuthenticationFilter;
import org.springframework.social.security.SpringSocialConfigurer;

/**
 * create by tangbj on 2018/4/4
 */
public class WsmhzSpringSocialConfigurer extends SpringSocialConfigurer{

    //社交登陆过滤器的url(与回调地址匹配)
    private String filterProcessesUrl;

    public WsmhzSpringSocialConfigurer(String filterProcessesUrl) {
        this.filterProcessesUrl = filterProcessesUrl;
    }

    @SuppressWarnings("unchecked")
    @Override
    protected <T> T postProcess(T object) {
        SocialAuthenticationFilter filter = (SocialAuthenticationFilter) super.postProcess(object);
        filter.setFilterProcessesUrl(filterProcessesUrl);
        return (T) filter;
    }
}
